using System.ComponentModel;

namespace AuthService.Domain.Auth
{
    /// <summary>
    /// 认证结果枚举
    /// </summary>
    public enum AuthResult
    {
        /// <summary>
        /// 成功
        /// </summary>
        [Description("成功")]
        Success = 0,

        /// <summary>
        /// 失败
        /// </summary>
        [Description("失败")]
        Failed = 1,

        /// <summary>
        /// 账户不存在
        /// </summary>
        [Description("账户不存在")]
        AccountNotFound = 2,

        /// <summary>
        /// 密码错误
        /// </summary>
        [Description("密码错误")]
        InvalidPassword = 3,

        /// <summary>
        /// 账户已锁定
        /// </summary>
        [Description("账户已锁定")]
        AccountLocked = 4,

        /// <summary>
        /// 账户已禁用
        /// </summary>
        [Description("账户已禁用")]
        AccountDisabled = 5,

        /// <summary>
        /// 账户已过期
        /// </summary>
        [Description("账户已过期")]
        AccountExpired = 6,

        /// <summary>
        /// 邮箱未验证
        /// </summary>
        [Description("邮箱未验证")]
        EmailNotVerified = 7,

        /// <summary>
        /// 手机号未验证
        /// </summary>
        [Description("手机号未验证")]
        PhoneNotVerified = 8,

        /// <summary>
        /// 需要双因子认证
        /// </summary>
        [Description("需要双因子认证")]
        TwoFactorRequired = 9,

        /// <summary>
        /// 双因子认证失败
        /// </summary>
        [Description("双因子认证失败")]
        TwoFactorFailed = 10,

        /// <summary>
        /// 密码过期
        /// </summary>
        [Description("密码过期")]
        PasswordExpired = 11,

        /// <summary>
        /// 首次登录需要修改密码
        /// </summary>
        [Description("首次登录需要修改密码")]
        FirstLoginPasswordChange = 12,

        /// <summary>
        /// IP地址不在允许范围
        /// </summary>
        [Description("IP地址不在允许范围")]
        IpAddressNotAllowed = 13,

        /// <summary>
        /// 设备不被信任
        /// </summary>
        [Description("设备不被信任")]
        DeviceNotTrusted = 14,

        /// <summary>
        /// 登录时间不在允许范围
        /// </summary>
        [Description("登录时间不在允许范围")]
        LoginTimeNotAllowed = 15,

        /// <summary>
        /// 并发登录数量超限
        /// </summary>
        [Description("并发登录数量超限")]
        ConcurrentLoginExceeded = 16,

        /// <summary>
        /// 可疑活动检测
        /// </summary>
        [Description("可疑活动检测")]
        SuspiciousActivity = 17,

        /// <summary>
        /// 系统维护中
        /// </summary>
        [Description("系统维护中")]
        SystemMaintenance = 18,

        /// <summary>
        /// 服务不可用
        /// </summary>
        [Description("服务不可用")]
        ServiceUnavailable = 19,

        /// <summary>
        /// 内部服务器错误
        /// </summary>
        [Description("内部服务器错误")]
        InternalServerError = 20
    }

    /// <summary>
    /// 认证方式枚举
    /// </summary>
    public enum AuthenticationMethod
    {
        /// <summary>
        /// 用户名密码
        /// </summary>
        [Description("用户名密码")]
        UsernamePassword = 0,

        /// <summary>
        /// 邮箱密码
        /// </summary>
        [Description("邮箱密码")]
        EmailPassword = 1,

        /// <summary>
        /// 手机号验证码
        /// </summary>
        [Description("手机号验证码")]
        PhoneNumberVerification = 2,

        /// <summary>
        /// 单点登录
        /// </summary>
        [Description("单点登录")]
        SingleSignOn = 3,

        /// <summary>
        /// LDAP认证
        /// </summary>
        [Description("LDAP认证")]
        Ldap = 4,

        /// <summary>
        /// OAuth2
        /// </summary>
        [Description("OAuth2")]
        OAuth2 = 5,

        /// <summary>
        /// OpenID Connect
        /// </summary>
        [Description("OpenID Connect")]
        OpenIdConnect = 6,

        /// <summary>
        /// SAML2
        /// </summary>
        [Description("SAML2")]
        Saml2 = 7,

        /// <summary>
        /// API密钥
        /// </summary>
        [Description("API密钥")]
        ApiKey = 8,

        /// <summary>
        /// JWT Token
        /// </summary>
        [Description("JWT Token")]
        Jwt = 9,

        /// <summary>
        /// 数字证书
        /// </summary>
        [Description("数字证书")]
        Certificate = 10,

        /// <summary>
        /// 生物识别
        /// </summary>
        [Description("生物识别")]
        Biometric = 11,

        /// <summary>
        /// 硬件令牌
        /// </summary>
        [Description("硬件令牌")]
        HardwareToken = 12,

        /// <summary>
        /// 社交登录
        /// </summary>
        [Description("社交登录")]
        Social = 13,

        /// <summary>
        /// 无密码登录
        /// </summary>
        [Description("无密码登录")]
        Passwordless = 14
    }

    /// <summary>
    /// 双因子认证类型枚举
    /// </summary>
    public enum TwoFactorAuthenticationType
    {
        /// <summary>
        /// 禁用
        /// </summary>
        [Description("禁用")]
        Disabled = 0,

        /// <summary>
        /// 短信验证码
        /// </summary>
        [Description("短信验证码")]
        Sms = 1,

        /// <summary>
        /// 邮箱验证码
        /// </summary>
        [Description("邮箱验证码")]
        Email = 2,

        /// <summary>
        /// Google Authenticator (TOTP)
        /// </summary>
        [Description("Google Authenticator")]
        GoogleAuthenticator = 3,

        /// <summary>
        /// Microsoft Authenticator
        /// </summary>
        [Description("Microsoft Authenticator")]
        MicrosoftAuthenticator = 4,

        /// <summary>
        /// 手机应用推送
        /// </summary>
        [Description("手机应用推送")]
        MobilePush = 5,

        /// <summary>
        /// 硬件令牌
        /// </summary>
        [Description("硬件令牌")]
        HardwareToken = 6,

        /// <summary>
        /// 智能卡
        /// </summary>
        [Description("智能卡")]
        SmartCard = 7,

        /// <summary>
        /// 生物识别
        /// </summary>
        [Description("生物识别")]
        Biometric = 8,

        /// <summary>
        /// 语音验证
        /// </summary>
        [Description("语音验证")]
        Voice = 9,

        /// <summary>
        /// 备用恢复码
        /// </summary>
        [Description("备用恢复码")]
        RecoveryCode = 10,

        /// <summary>
        /// 多选验证
        /// </summary>
        [Description("多选验证")]
        MultiFactor = 11
    }

    /// <summary>
    /// 登录尝试类型枚举
    /// </summary>
    public enum LoginAttemptType
    {
        /// <summary>
        /// 登录
        /// </summary>
        [Description("登录")]
        Login = 0,

        /// <summary>
        /// 登出
        /// </summary>
        [Description("登出")]
        Logout = 1,

        /// <summary>
        /// 刷新令牌
        /// </summary>
        [Description("刷新令牌")]
        RefreshToken = 2,

        /// <summary>
        /// 验证令牌
        /// </summary>
        [Description("验证令牌")]
        ValidateToken = 3,

        /// <summary>
        /// 撤销令牌
        /// </summary>
        [Description("撤销令牌")]
        RevokeToken = 4,

        /// <summary>
        /// 双因子认证
        /// </summary>
        [Description("双因子认证")]
        TwoFactor = 5,

        /// <summary>
        /// 忘记密码
        /// </summary>
        [Description("忘记密码")]
        ForgotPassword = 6,

        /// <summary>
        /// 重置密码
        /// </summary>
        [Description("重置密码")]
        ResetPassword = 7,

        /// <summary>
        /// 修改密码
        /// </summary>
        [Description("修改密码")]
        ChangePassword = 8,

        /// <summary>
        /// 检查权限
        /// </summary>
        [Description("检查权限")]
        CheckPermission = 9,

        /// <summary>
        /// API调用
        /// </summary>
        [Description("API调用")]
        ApiCall = 10
    }

    /// <summary>
    /// 设备信任状态枚举
    /// </summary>
    public enum DeviceTrustStatus
    {
        /// <summary>
        /// 未知
        /// </summary>
        [Description("未知")]
        Unknown = 0,

        /// <summary>
        /// 不信任
        /// </summary>
        [Description("不信任")]
        Untrusted = 1,

        /// <summary>
        /// 临时信任
        /// </summary>
        [Description("临时信任")]
        TemporarilyTrusted = 2,

        /// <summary>
        /// 长期信任
        /// </summary>
        [Description("长期信任")]
        Trusted = 3,

        /// <summary>
        /// 高度信任
        /// </summary>
        [Description("高度信任")]
        HighlyTrusted = 4,

        /// <summary>
        /// 已撤销
        /// </summary>
        [Description("已撤销")]
        Revoked = 5,

        /// <summary>
        /// 已挂失
        /// </summary>
        [Description("已挂失")]
        Lost = 6
    }

    /// <summary>
    /// 认证级别枚举
    /// </summary>
    public enum AuthenticationLevel
    {
        /// <summary>
        /// 无认证
        /// </summary>
        [Description("无认证")]
        None = 0,

        /// <summary>
        /// 基础认证
        /// </summary>
        [Description("基础认证")]
        Basic = 1,

        /// <summary>
        /// 标准认证
        /// </summary>
        [Description("标准认证")]
        Standard = 2,

        /// <summary>
        /// 高级认证
        /// </summary>
        [Description("高级认证")]
        Advanced = 3,

        /// <summary>
        /// 严格认证
        /// </summary>
        [Description("严格认证")]
        Strict = 4,

        /// <summary>
        /// 军事级认证
        /// </summary>
        [Description("军事级认证")]
        Military = 5
    }
}